//1. 引入 fs 模块
// const fs = require("fs");
const fs = require("fs")

//读取 "悯农"
function readMinNong(){
    fs.readFile("./resources/悯农.md", (err, data) => {
        return new Promise((resolve, reject) => {
            //如果失败
            if(err) reject(err)
            //如果成功
            resolve(data);
    })
})
}

function readEEE(){
    fs.readFile("./resources/鹅鹅鹅.md", (err, data) => {
        return new Promise((resolve, reject) => {
            //如果失败
            if(err) reject(err)
            //如果成功
            resolve(data);
    })
})
}

//声明一个 async 函数
async function main(){
    //获取悯农内容
    let minnong = await readMinNong()
    //获取鹅鹅鹅诗内容
    let eee = await readEEE()

    console.log(minnong.toString());
    console.log(eee.toString());

}

//调用函数
main()